#ifndef AGORA_BUFFER
# define AGORA_BUFFER

#include "IBuffer.hpp"

template<typename A>
class Buffer : public IBuffer<A>
{
public:
	Buffer<A>(unsigned int size);
	~Buffer<A>();
	virtual int Write(A *data, unsigned int size);
	virtual const A& operator[](unsigned int i);
	virtual A*  Read(unsigned int size);
	virtual int GoForward(unsigned int size);
	virtual unsigned int Size();
	virtual unsigned int SizeMax();
	virtual void Clean();
private:
	A *_data;
	unsigned int _currentStart;
	unsigned int _end;
	unsigned int _sizeMax;
	unsigned int _size;
};

#endif